package org.xczy.boot.utils;

import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;

@Component
public class DateUtil {
  public static String getFormatDate(){
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    Date currentDate = new Date();
    return sdf.format(currentDate);
  }
  public static String getFormatDate(String format){ // 做成枚举类型使用
    SimpleDateFormat sdf = new SimpleDateFormat(format);
    Date currentDate = new Date();
    return sdf.format(currentDate);
  }
}
